extends "../kebu-1/kebu-1.gd"

func _extInit():
	._extInit()
	lv = 2
	addSkill("每{cd}秒对当前目标造成[血上限5%]的技能伤害(每100点雷击+8%的伤害系数)", "白虹", "kebu2", 6)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "kebu2":
		kebu2()
var skIndex3 = 0
var skIndex4 = 0
func kebu2(cha = aiCha):
	if cha == null:return
	var dmg = 0.05 + att.mgiAtk/1000.0 * 0.8
	if cha.type == sys.CharaClass.BOSS:dmg *= 0.1
	skIndex3 += 1
	if skIndex3 > 2 and lv > 2:
		skIndex4 += 1
		if skIndex4 > 1 and lv > 3:
			utils.createSkillTextEff("残月", position)
			for i in getAllChas(1):
				azurHurtChara(i, i.att.maxHp*dmg, sys.HurtType.WEAPON, sys.AtkType.SKILL, "白虹", upgraded == 1, p2)
		else:
			utils.createSkillTextEff("夕星", position)
			for i in getCellChas(aiCha.cell, 2, 1):
				azurHurtChara(i, i.att.maxHp*dmg, sys.HurtType.WEAPON, sys.AtkType.SKILL, "白虹", upgraded == 1, p2)
	else:
		azurHurtChara(aiCha, aiCha.att.maxHp*dmg, sys.HurtType.WEAPON, sys.AtkType.SKILL, "白虹", upgraded == 1, p2)

func _onBattleStart():
	._onBattleStart()
	skIndex3 = 0
	skIndex4 = 0

var p2 = 1	